package com.liliudong.pinkyponk.biz.sys.request;

import com.liliudong.pinkyponk.biz.sys.enums.SysUserGander;
import com.liliudong.pinkyponk.biz.sys.enums.SysUserStatus;
import com.liliudong.pinkyponk.core.validator.Create;
import com.liliudong.pinkyponk.core.validator.Login;
import com.liliudong.pinkyponk.core.validator.Update;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * SysUserRequest
 *
 * @author liliudong
 * @date 2022-05-26 15:21
 **/
@Data
public class SysUserRequest {

    /**
     *
     */
    @NotNull(message = "Id is null", groups = {Update.class})
    private Long id;

    /**
     *
     */
    @NotBlank(message = "Username is blank", groups = {Create.class, Update.class, Login.class})
    private String username;

    /**
     *
     */
    @NotBlank(message = "Password is blank", groups = {Create.class, Update.class, Login.class})
    private String password;

    /**
     *
     */
    @NotNull(message = "Age is null", groups = {Create.class, Update.class})
    private Integer age;

    /**
     * 性别:1.男 2.女 0.未知
     */
    @NotNull(message = "Grander is null", groups = {Create.class, Update.class})
    private SysUserGander grander;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 邮箱
     */
    @Email
    private String email;

    /**
     * 账号过期时间
     */
    private Date expireTime;

    /**
     * 账号状态
     */
    private SysUserStatus status;
    /**
     * avatar
     */
    @URL
    private String avatar;
    /**
     * nickName
     */
    private String nickName;
    /**
     * 角色集合
     */
    @NotEmpty(message = "Role is empty", groups = {Create.class, Update.class})
    private List<Integer> roleIds;
    /**
     * 用户组集合
     */
    @NotEmpty(message = "Organization is empty", groups = {Create.class, Update.class})
    private List<Integer> orgIds;


}
